package com.foreveross.proxyip.application.pool.vo;

import java.util.ArrayList;
import java.util.List;

import com.foreveross.proxyip.core.BaseCode;
import com.foreveross.proxyip.core.redis.PiRedisExecption;
import com.foreveross.proxyip.entity.ChannelEntity;
import com.foreveross.proxyip.infra.conf.PropertyUtils;
import com.foreveross.proxyip.infra.conf.proxyip.ProxyIpPropertiesLoader;
import com.foreveross.proxyip.util.Config;

public class ChannelPoolVo {
	/****当前池大小****/
	Long currNum = 0L;
	/***ip最大使用次数***/
	Integer ipMaxUsedCount = 0;
	/***渠道池检测间隔时间***/
	Integer channelInSeparationTime = 0;
	/***线程数量***/
	Long threadCount = 0L;
	/********渠道池最小ip数********/
	Integer channelProxyMin=0;
	/********渠道池最大ip数********/
	Integer channelProxMax=0;
	/********公共池检出时间间隔********/
	Integer channelOutSeparationTime=0;
	
	Integer threadMaxIpCount = 0;
	
	String channelCode = null;
	
	List<ChannelEntity> channels = new ArrayList<ChannelEntity>();
	

	/***ip集合
	 * @throws PiRedisExecption ***/
	public ChannelPoolVo(){
		try {
			ipMaxUsedCount = Integer.parseInt(BaseCode.getValue("CHANNEL_MAX_USED_COUNT"));
		
		
	
		channelInSeparationTime = Integer.parseInt( BaseCode.getValue("CHANNEL_IN_SEPARATION_TIME"));
		
		threadMaxIpCount = Integer.parseInt(BaseCode.getValue("CHANNEL_THREAD_MAX_COUNT"));
		
		
		
		channelProxyMin= Integer.parseInt(BaseCode.getValue("CHANNEL_PROXY_MIN"));
		
		
		channelProxMax= Integer.parseInt( BaseCode.getValue("CHANNEL_PROXY_MAX"));
		
		
		channelOutSeparationTime= Integer.parseInt(BaseCode.getValue("CHANNEL_OUT_SEPARATION_TIME"));
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (PiRedisExecption e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public Long getCurrNum() {
		return currNum;
	}
	public void setCurrNum(Long currNum) {
		this.currNum = currNum;
	}
	public Integer getIpMaxUsedCount() {
		return ipMaxUsedCount;
	}
	
	public Long getThreadCount() {
		return threadCount;
	}

	public void setThreadCount(Long threadCount) {
		this.threadCount = threadCount;
	}
	

	public List<ChannelEntity> getChannels() {
		return channels;
	}

	public void setChannels(List<ChannelEntity> channels) {
		this.channels = channels;
	}

	public void setIpMaxUsedCount(Integer ipMaxUsedCount) {
		this.ipMaxUsedCount = ipMaxUsedCount;
	}

	public Integer getThreadMaxIpCount() {
		return threadMaxIpCount;
	}

	public void setThreadMaxIpCount(Integer threadMaxIpCount) {
		this.threadMaxIpCount = threadMaxIpCount;
	}

	public String getChannelCode() {
		return channelCode;
	}

	public void setChannelCode(String channelCode) {
		this.channelCode = channelCode;
	}

	public Integer getChannelInSeparationTime() {
		return channelInSeparationTime;
	}

	public void setChannelInSeparationTime(Integer channelInSeparationTime) {
		this.channelInSeparationTime = channelInSeparationTime;
	}

	public Integer getChannelProxyMin() {
		return channelProxyMin;
	}

	public void setChannelProxyMin(Integer channelProxyMin) {
		this.channelProxyMin = channelProxyMin;
	}

	public Integer getChannelProxMax() {
		return channelProxMax;
	}

	public void setChannelProxMax(Integer channelProxMax) {
		this.channelProxMax = channelProxMax;
	}

	public Integer getChannelOutSeparationTime() {
		return channelOutSeparationTime;
	}

	public void setChannelOutSeparationTime(Integer channelOutSeparationTime) {
		this.channelOutSeparationTime = channelOutSeparationTime;
	}
     
	
}
